Fast hit override

ABSTRACT

In one embodiment, a cache comprises a tag memory and a comparator. The tag memory is configured to store tags of cache blocks stored in the cache, and is configured to output at least one tag responsive to an index corresponding to an input address. The comparator is coupled to receive the tag and a tag portion of the input address, and is configured to compare the tag to the tag portion to generate a hit/miss indication. The comparator comprises dynamic circuitry, and is coupled to receive a control signal which, when asserted, is defined to force a first result on the hit/miss indication independent of whether or not the tag portion matches the tag. The comparator also comprises circuitry coupled to receive the control signal and configured to inhibit a state change on an output of the dynamic circuitry during an evaluate phase of the dynamic circuitry to produce the first result responsive to an assertion of the control signal.

This patent application is a continuation of U.S. patent applicationSer. No. 11/173,685, filed Jul. 1, 2005, now U.S. Pat. No. 8,015,356,which is incorporated herein by reference in its entirety.

BACKGROUND

1. Field of the Invention

This invention is related to the field of caches and, more particularly,to overriding hit/miss indications in a cache.

2. Description of the Related Art

Caches are typically used to reduce the average latency of accesses to amain memory system. The main memory system typically includes dynamicrandom access memory (DRAM) such as double data rate (DDR) synchronousDRAM (SDRAM). Caches typically have one or more orders of magnitude lesscapacity than the memory system, and also typically employ lower latencymemory than the DRAM used in the memory system. Caches store copies of asubset of the data in memory, in units of cache blocks or cache lines. Acache block/line is the smallest unit of allocation/deallocation ofstorage space in the cache. Typically, caches store recently-accessedcache blocks.

Since a given storage location in the cache may store cache blocks fromdifferent memory locations in the memory system, the cache includes tagsthat identify the memory address of each cache block. When the cache isaccessed, an input address is supplied for the memory location beingaccessed. The input address is compared to tags of cache block storagelocations that are eligible to store the cache block identified by theaddress. Which cache block storage locations may store the cache blockis dependent on the cache design, as discussed below. If a match betweenthe input address and a tag is detected, the access is referred to as ahit and the access may be completed in cache. If there is no matchbetween the input address and a tag, the access is referred to as a missand an access to the memory system is performed to complete theoperation.

There are various cache designs that are often used. A direct-mappeddesign provides one cache block storage location that may be used for agiven cache block, based on the address of that cache block. Typically,a portion of the address (referred to as the “index”) is used to selectthe cache block storage location. Thus, multiple addresses that have anequal index may map to the same cache block storage location. Ifmultiple different addresses mapped to the same cache block storagelocation are accessed, the cache blocks corresponding to those addressesexperience contention for the cache block storage location. In a setassociative design, multiple cache block storage locations (collectivelyreferred to as a “set”) are eligible for a given address having a givenindex. Thus, contention among the addresses having the same index may beeased by the ability to store more than one cache block in the set. In afully associative design, any cache storage location may be used for acache block at any address.

In normal operation, one or more tags are read from the cache andcompared to the input address to detect hit or miss. Additionally, thehit/miss result may be used to select which cache location outputs datafor a read. There are some cases in which it is desirable to overridethe hit/miss detection via the tag comparison (e.g. for test purposes,to evict a cache block from the cache, etc.). Typically, such overridesare implemented by muxing the output of the tag comparison with theoverride hit/miss signals, and selecting the override or the tagcomparison result by controlling the mux. However, the tag read,comparison, and output selection is often a critical timing path whichmay be a limiter on the clock frequency at which the cache (or anintegrated circuit that includes the cache) may be operated. Byinserting the muxes, the critical path is lengthened.

SUMMARY

In one embodiment, a cache comprises a tag memory and a comparator. Thetag memory is configured to store tags of cache blocks stored in thecache, wherein the tag memory is coupled to receive an indexcorresponding to an input address and is configured to output at leastone tag responsive to the index. The comparator is coupled to receivethe tag from the tag memory and a tag portion of the input address,wherein the comparator is configured to compare the tag to the tagportion of the input address to generate a hit/miss indication. Thecomparator comprises dynamic circuitry and is coupled to receive acontrol signal which, when asserted, is defined to force a first resulton the hit/miss indication independent of whether or not the tag portionof the input address matches the tag from the tag memory. The comparatorcomprises first circuitry coupled to receive the control signal andconfigured to inhibit a state change on an output of the dynamiccircuitry during an evaluate phase of the dynamic circuitry to producethe first result. An integrated circuit coupled to the cache, andconfigured to generate the input address and the control signal is alsocontemplated. A method is further contemplated.

BRIEF DESCRIPTION OF THE DRAWINGS

The following detailed description makes reference to the accompanyingdrawings, which are now briefly described.

FIG. 1 is a block diagram of one embodiment of an integrated circuit.

FIG. 2 is a block diagram of one embodiment of a cache shown in FIG. 1.

FIG. 3 is a block diagram of one embodiment of a comparator shown inFIG. 2.

FIG. 4 is a block diagram of one embodiment of a dynamic XOR/OR circuitshown in FIG. 3.

FIG. 5 is a circuit diagram illustrating one embodiment of a dynamicXOR/OR circuit.

FIG. 6 is an example of override in the circuit diagram of FIG. 5.

FIG. 7 is a flowchart illustrating one embodiment of a method.

While the invention is susceptible to various modifications andalternative forms, specific embodiments thereof are shown by way ofexample in the drawings and will herein be described in detail. Itshould be understood, however, that the drawings and detaileddescription thereto are not intended to limit the invention to theparticular form disclosed, but on the contrary, the intention is tocover all modifications, equivalents and alternatives falling within thespirit and scope of the present invention as defined by the appendedclaims.

DETAILED DESCRIPTION OF EMBODIMENTS

Turning now to FIG. 1, a block diagram of one embodiment of anintegrated circuit 10 is shown. In the illustrated embodiment, theintegrated circuit 10 includes logic circuitry 12 and a cache 14 coupledto the logic 12. While the illustrated embodiment shows the logic 12 andthe cache 14 integrated onto a single semiconductor substrate, otherembodiments may implement the cache 14 separate from the integratedcircuit 10.

The logic 12 may generally comprise circuitry that implements theoperation for which the integrated circuit 10 is designed. For example,the logic 12 may implement a processor that is configured to executeinstructions stored in memory and operate on data stored in memory.Alternatively, the logic 12 may implement direct memory access (DMA)circuitry or other input/output (I/O) circuitry that may read/writememory. Generally, the logic 12 may include any circuitry that mayread/write memory data from a memory system (not shown), and some of thememory data may be cached in the cache 14. The term data, or memorydata, is being used herein in the generic sense to refer to anyinformation stored in memory (e.g. instructions for execution, data tobe operated upon, etc.). When performing memory read/write operations,the logic 12 may be configured to access the cache 14.

Particularly, the logic 12 may provide an address of a memory locationbeing accessed to the cache 14 (illustrated as Addr in FIG. 1), alongwith various control (Ctl) inputs. The control inputs may includewhether the operation is a read or write, for example. Additionally, thecontrol inputs may include force hit and force miss inputs, described inmore detail below. The cache 14 may lookup the address and determine ifa cache block corresponding to the address is stored in the cache 14.The cache 14 may signal hit or miss to the logic 12. For example, in theillustrated embodiment, a hit signal is provided by the cache 14, whichmay be asserted to indicate a hit (the corresponding cache block isstored in the cache 14) or deasserted to indicate a miss (thecorresponding cache block is not stored in the cache 14). A cache blockmay correspond to an address if the cache block includes the byteidentified by the address. Finally, the data for the read/writeoperation may be transferred between the logic 12 and the cache 14, withthe direction of transfer dependent on whether a read or write operationis being performed.

The force hit and force miss control signals may be used by the logic 12(and/or external circuitry to the integrated circuit 10, in someembodiments) to override the hit/miss determination made by the cache 14(via tag comparison to the input address). Particularly, the force hitcontrol signal(s) may be asserted to force a cache hit, and the forcemiss control signal(s) may be asserted to force a cache miss. If neitherforce hit nor force miss signals are asserted, then no override occursand the tag comparison result is used to determine cache hit/miss. Inone embodiment, the cache 14 comprises a set associative cache and theremay be a force hit signal and a force miss signal for each way in theset. In another embodiment, the cache 14 may be a direct-mapped cacheand there may be one force hit signal and one force miss signal. Infully associative embodiments, there may be one force hit signal and oneforce miss signal for each cache block storage location in the cache 14.

The logic 12 may use the force hit/force miss signals in a variety offashions. For example, the logic 12 may include built-in self-test(BIST) logic used to test the functionality of the integrated circuit 10and more particularly the cache 14. Among other things, the BIST logicmay test that the data memory in the cache 14 is functional. Toread/write a cache block storage location in the data memory infunctional (non-test) mode, a hit to that cache block storage locationmust be detected. By using the force hit/force miss controls to thecache 14, the BIST logic may avoid the need to set up addresses in thetag memory in the cache 14 (see FIG. 2) to cause a hit in the desiredcache block storage location in the data memory when testing the datamemory. Additionally, avoiding the use of the tag memory may permit thedata memory to be tested without requiring the tag memory to befunctional. When diagnosing failures, the ability to isolate a failureto the tag memory or data memory, or to detect failures in the datamemory even if the tag memory is faulty, may be useful. For example, theBIST logic may assert the force hit signal(s) to cause a hit in thedesired cache block storage location to write test data to the desiredcache block storage location or read test data from the desired cacheblock storage location.

In one embodiment, the logic 12 may be configured to perform variouscache operations (“ops”) which are defined to read a tag from the tagmemory in the cache or data from the data memory in the cache into aregister. The cache op identifies the cache location to be read (e.g.the way). Such a cache op may be implemented by forcing a hit during theaccess to the cache 14 for the cache op in the identified way.

The cache 14 is finite, and thus contention for storage space in thecache 14 may cause a cache block stored in the cache 14 to be evicted tomake room for another cache block. In such cases, the address of thecache block to be evicted may not be available. For example, a cachemiss may be detected for a cache block, and one of the cache blockstorage locations in the cache 14 may be allocated to store the missingcache block. The allocated cache block storage location may be selectedin any fashion (e.g. random, least recently used (LRU), partial LRU,modified LRU, etc.). The allocated cache block storage location may bestoring a cache block, and the cache block is evicted from the cache. Ifthe evicted cache block is modified with respect to the data stored inthe main memory system, the evicted cache block is read from theallocated cache block storage location to be written back to memory.During the read operation to read the evicted cache block from thecache, the index is the same as the index for the missing cache blockbut the remainder of the address of the evicted cache block may not beknown until the tags are read. By forcing a hit in the allocated cacheblock storage location using the force hit signal(s), the evicted cacheblock may be read for writing to memory or a lower level cache (if acache hierarchy is used). The tag from the tag memory may also becaptured to obtain the address of the evicted cache block.

In the above cases, the force miss signal(s) may be used to ensure thata hit is not detected in other cache block storage locations than thedesired cache block storage location (e.g. if the tag portion of theaddress happens to match a different tag in the tag memory). There mayalso be other reasons to force a miss, e.g. for test purposes.

It is noted that, while one cache 14 is illustrated in FIG. 1, there maybe multiple caches in other embodiments.

Turning now to FIG. 2, a block diagram of one embodiment of the cache 14is shown. In the illustrated embodiment, the cache 14 includes a tagmemory 20, a data memory 22, a set of comparators 24A-24N, an OR gate26, and a multiplexor (mux) 28. The cache 14 is coupled to receive aninput address from the logic 12, and selects an index and a tag portionfrom the input address. The index is input to the tag memory 20 and thedata memory 22 to select a set of cache block storage locations foraccess. The tag memory 20 outputs tags corresponding to the indexedcache block storage locations to the comparators 24A-24N, which are alsocoupled to receive the tag portion of the input address. The comparators24A-24N are also coupled to receive force hit and force miss signals(e.g. force hit 0 and force miss 0 to the comparator 24A and force hit Nand force miss N to the comparator 24N. The comparators are configuredto generate hit signals (HitW0 from comparator 24A and HitWN fromcomparator 24N), which are provided to the OR gate 26 (which generatesthe hit signal to the logic 12) and as selection controls to the mux 28.The mux 28 is coupled to receive data read from the data memory 22 andto provide data to the logic 12. Data input from the logic 12 may alsobe provided to the data memory 22 for storage (not shown in FIG. 2).

The data memory 22 comprises the cache block storage locations thatstore the data in the cache 14. The tag memory 20 may includecorresponding tag storage locations, each tag storage location storing atag for a corresponding cache block storage location in the data memory22. The tag storage locations may also store various status bits, suchas a valid bit for the cache line, various bits that indicate the stateof the cache line, etc. The data memory 22 and the tag memory 20 maycomprise static random access memory (SRAM), in some embodiments.

In the illustrated embodiment, the cache 14 is set associative and thusthe tag memory 20 and the data memory 22 are illustrated as having ways0 to N. Each way in the data memory 22 includes a cache block storagelocation for each index, and each way in the tag memory 20 includes acorresponding tag storage location for each cache block storagelocation. In response to a given index, the tag memory 20 may output atag from each way and the data memory 22 may output data from each way.Alternatively, the data memory 22 may output a portion of the cacheblock (e.g. in banked implementations, where one or more bits of thecache block offset are used to select the bank). In some embodiments,the mux 28 may be incorporated into the data memory 22 (e.g. columnmuxing of bit lines in the data memory 22). Generally, an index maycomprise any value that is derived, at least in part, from an inputaddress to select storage locations in a memory for access in responseto that address. In some cases, such as that shown in FIG. 2, the indexmay be selected address bits from the input address. In other cases, theselected address bits may be logically combined with other data toselect a location.

The comparators 24A-24N are each coupled to receive a tag from arespective way of the tag memory 20, and compare the tag to the tagportion of the input address. In the illustrated embodiment, thecomparators 24A-24N each output a hit signal, which may be asserted toindicate a hit and deasserted to indicate a miss. Other embodiments mayoutput a miss signal, if desired. The tag, and the tag portion of theinput address, may be that portion of the address which uniquelyidentifies a cache block that may be mapped to a given cache blockstorage location. Thus, the tag/tag portion excludes the offset bits ofthe address (which select bytes within the cache block) and alsoexcludes the address bits used to form the index. Typically, the offsetbits are the least significant bits of the address, the next leastsignificant bits after the offset form the index, and the remainingaddress bits form the tag. However, any selected sets of bits may formthe index and tag.

Additionally, the comparators 24A-24N receive the force hit and forcemiss signals, and override the comparison result to force a hit(assertion of the output signal from the comparator 24A-24N, in thisembodiment) or miss (deassertion of the output signal from thecomparator 24A-24N, in this embodiment) if the force hit or force misssignals are asserted, respectively. The circuitry that overrides thecomparison result to force the hit or miss result may be incorporatedinto the comparators 24A-24N to avoid lengthening the timing path fordetecting a cache hit/miss in normal operation, in some embodiments.Additional details for some embodiments are provided below.

The hit signals output by the comparators 24A-24N form selectioncontrols for the mux 28, to select read output data from the cache 14.The OR gate 26 combines the hit signals to provide the hit signal to thelogic 12.

As mentioned above, while the illustrated embodiment outputs hit signalsfrom the comparators 24A-24N, other embodiments may output miss signals.Thus, the comparators 24A-24N may generally be viewed as outputting ahit/miss indication which indicates whether or not the input address isa hit or miss in the corresponding way of the cache 14 (and which may beforced to a desired hit/miss result using the force hit and force misssignals).

While the illustrated embodiment is a set associative cache, otherembodiments may be direct-mapped for fully associative. In direct-mappedembodiments, a single comparator 24 may be used and the mux 28 may beeliminated.

Turning next to FIG. 3, a block diagram of one embodiment of thecomparator 24A is shown. Other comparators such as comparator 24N may besimilar. Also illustrated in FIG. 3 is a senseamp circuit 30 that may bepart of the tag memory 20.

In the illustrated embodiment, the comparator 24A employs dynamic logiccircuitry to perform the comparison. Generally, dynamic circuitry isprecharged to a first state on its output during a precharge phase, andthen the dynamic circuitry evaluates responsive to inputs during anevaluate phase. During the evaluate phase, the dynamic circuitry mayconditionally change to the second state based on the inputs. Forexample, typical complementary metal-oxide-semiconductor (CMOS) dynamiclogic includes a precharge to a low state on the output and aconditional evaluation to a high state. The output is driven by aninverter having its input coupled to an internal node which isprecharged to a high state and conditionally evaluated to a low statebased on inputs and the logic function implemented by the circuitry. Theprecharge is accomplished with a positive channel MOS (PMOS) transistor,and the evaluation is accomplished by negative channel MOS (NMOS)transistors having gates coupled to the input signals. Accordingly,state change on the output occurs based on at least one of the inputsignals transitioning to a high state.

Since state change in the evaluate phase may occur if the input signalstransition high but may not occur if the input signals do not transitionhigh, a signal that transitions high to represent the logical low stateof the bit is used if the circuitry is to react to the logical low stateof the bit. Accordingly, if both the logical high state and the logicallow state of a bit are used in the logic, then a pair of dynamic signalsare used to represent the bit. The first of the pair represents the truevalue of the bit, and thus transitions high if the bit is logicallyhigh. The second of the pair represents the complement of the bit, andthus transitions high if the bit is logically low. Therefore, duringdynamic logic evaluation, one of the pair of signals transitions basedon the logical state of the bit. In the drawings, the signal thatrepresents the complement of the bit is labeled with a bar over it (e.g.the Tag and Addr labels with bars over them in FIG. 3).

Since the comparator 24A is attempting to detect equality between thetag and the tag portion of the address, the comparator 24A uses both ofthe pair of signals that correspond to a given tag bit and both of thepair of signals that corresponding to a given bit of the tag portion ofthe input address.

The senseamp 30 in the tag memory 20 may output the pairs of dynamicsignals for each bit of the tag read from the tag memory (shown as tagand tag bar in FIG. 4). The senseamp is coupled to receive a clocksignal (clk) and “launches” the tag and tag bar signals responsive tothe clock signal. A dynamic signal may be launched by asserting the hightransition on the signal, if the signal is to transition for the currentevaluation, thus permitting the dynamic signal to cause output statechange for dynamic circuits to which it is an input. The clock signalmay also be provided to a dynamic exclusive OR (XOR)/OR circuit 32 (e.g.to control the precharge and evaluate phases of the dynamic XOR/ORcircuit 32) and to a clock gater circuit 34. The clock gater circuit 34is coupled to receive an inversion of the force hit 0 signal, through aninverter 36 that has its input coupled to the force hit 0 signal, on anenable input to the clock gater circuit 34. The output of the clockgater circuit 34, an enabled clock signal (EClk) is provided as a clockinput to another senseamp 38 that is coupled to receive the tag portionof the input address (Addr Tag). The senseamp 38 is configured to launchthe address and address bar signals (Addr and Addr bar in FIG. 3) to thedynamic XOR/OR circuit 32 responsive to the clock input.

The dynamic XOR/OR circuit 32 XORs each bit of the tag (represented bytag and tag bar dynamic signals) with the bit from the same bit positionof the tag portion of the input address (represented by address andaddress bar dynamic signals) and ORs the result of the XORs over all thebits of the tag and tag portion. Since an XOR produces a logical 0 ifits inputs are the same, the output of the OR function is a zero (low)if the bits of the tag and tag portion are all equal and a one (high) ifat least one of the bits are not equal. Therefore, the output XOR/ORfunction is asserted if the tag and tag portion of the input address donot match (a miss) and is deasserted if the tag and tag portion of theinput address do match (a hit). An inverter 40 is used to generate theHitW0 signal.

To force a hit result from the comparator 24A, the output of the XOR/ORcircuit 32 remains low, which is the precharge state of the circuit.Accordingly, if the dynamic XOR/OR circuit is prevented from changingstate during the evaluate phase, the result is a hit from the comparator24A. The clock gater circuit 34 may be used to gate the clock to thesenseamp 38, preventing the launch (assertion) of the dynamic signalpairs corresponding to the tag portion of the address. Since none of thedynamic signals assert, the dynamic XOR/OR circuit 32 is prevented fromchanging state in the evaluation and the result is a hit. According, theforce of a hit is accomplished without impacting the timing of the path,in some embodiments. In other embodiments, a clock gater circuit 34 maybe used to gate the clock to the dynamic XOR/OR circuit 32, if the clockis used to prevent evaluation until the evaluation phase begins (e.g. byincluding an NMOS transistor with the clock as its gate input in serieswith the NMOS transistors that form the logic function in the XOR/ORcircuit 32). In yet another embodiment, the clock gater circuit 34 maygate the clock to the senseamp 30, thus preventing the launch of the tagand tag bar signals to the dynamic XOR/OR circuit 32.

Generally, gating a clock refers to holding the clock in a steady state(e.g. low, in the present embodiment) rather than permitting the clockto oscillate between high and low. The clock gater circuit 34 includesat least one enable input, and may not gate the clock if the enable isasserted. If the enable is deasserted, the clock gater circuit 34 maygate the clock. It is noted that, in some embodiments, the clock gatercircuit 34 may have multiple enable inputs, or the force hit signal maybe logically combined with other enable signals to produce the enable tothe clock gater circuit 34.

To force a miss result on the comparator 24A, the dynamic XOR/OR circuit32 is forced to change state in the evaluate phase. The force miss 0signal may thus be coupled to the dynamic XOR/OR circuit 32 in FIG. 3and may cause the dynamic XOR/OR circuit 32 to change state, ifasserted. For example, as shown in FIG. 4, the force miss 0 signal maybe coupled as in input to the OR gate that produces the output signal.

In other embodiments, the force miss signal may be the signal that isused to inhibit state change of the dynamic circuitry in the comparator24A. For example, if the dynamic XOR/OR circuit 32 and the inverter 40were replaced with a dynamic XNOR/AND circuit, the precharge state ofthe XNOR/AND circuit would be miss and the dynamic XNOR/AND circuit mayconditionally change state in the evaluate phase to indicate hit. Insuch an embodiment, an inversion of the force miss 0 signal may be inputto the clock gater 34 to gate the clock to force a miss result from thecomparator 24A. A hit result may be forced by ensuring that the dynamicXNOR/AND circuit changes state in the evaluate phase, e.g. by providingan inversion of the force hit 0 signal as an input to the AND.

While a senseamp circuit 38 is used to generate the address and addressbar dynamic signals, any circuit that is configured to launch pairs ofdynamic signals for each input bit to the circuit responsive to a clockinput may be used. For example, flops or other clocked storage deviceshaving dynamic signal outputs may be used, or any other dynamic signalgeneration circuit may be used.

Turning now to FIG. 4, a block diagram of one embodiment of the dynamicXOR/OR circuit 32 is shown. In the illustrated embodiment, a dynamicXOR/OR circuit 50 is shown producing an output that is an input to adynamic OR circuit 52. The dynamic XOR/OR circuit 50 is coupled toreceive the pairs of dynamic signals representing three bits (bits 0, 1,and 2) of the tag and the tag portion of the input address, and theoutput of the dynamic XOR/OR circuit 50 represents the result ofcomparing the three bits. Other inputs of the dynamic OR circuit 52 maybe coupled to other dynamic XOR/OR circuits similar to circuit 50, butcoupled to different sets of bits. One input of the dynamic OR circuit52 is coupled to the force miss 0 signal, and the output of the dynamicOR circuit 52 is the output of the dynamic XOR/OR circuit 32. Thecircuits 50 and 52 are both coupled to receive the clock input (Clk) aswell.

The dynamic XOR/OR circuit 50 may be accomplished as a single dynamicstage, as shown in FIG. 5. However, providing such a circuit to handleall of the tag bits in one stage may unduly load the internal node ofthe dynamic XOR/OR circuit 50, which may slow precharge and evaluationand increase power consumption. The number of bits handled in one stagemay be varied from embodiment to embodiment, e.g. as a function oftradeoffs in circuit size, capacitance, power consumption, etc. ORing ofoutputs of several such circuits may be used to generate the completecomparison result. While one level of dynamic OR 52 is shown in FIG. 4,other embodiments may implement several cascaded levels of dynamic OR.The force miss 0 signal may be an input at any such level.

FIG. 5 is a circuit diagram of one embodiment of the dynamic XOR/ORcircuit 50. In the illustrated embodiment, the circuit 50 includes PMOSprecharge transistor T₁ coupled between V_(DD) and a node 62, NMOStransistors T₂-T₃ coupled in series between the node 62 and ground, NMOStransistors T₄-T₆ coupled in series between the node 62 and ground, NMOStransistors T₆-T₇ coupled in series between the node 62 and ground, NMOStransistors T₈-T₉ coupled in series between the node 62 and ground, NMOStransistors T₁₀-T₁₁ coupled in series between the node 62 and ground,NMOS transistors T₁₂-T₁₃ coupled in series between the node 62 andground, PMOS keeper transistor T₁₄ coupled between VDD and the node 62,and inverter 60.

The transistors T₂-T₅ perform the XOR of the tag bit 0 and bit 0 of thetag portion of the address. Accordingly, the gates of transistors T₂-T₅are coupled to the tag 0 bar, address 0, tag 0, and address 0 barsignals, respectively, as shown in FIG. 5. Particularly, the transistorsT₂-T₃ discharge the precharge of the node 62 (and thus cause the outputinverter 60 to transition high) if the tag 0 bar signal and the address0 signal are both asserted. That is, the transistors T₂-T₃ discharge thenode 62 if bit 0 of the tag is 0 and bit 0 of the tag portion of theaddress is a 1, which is one case of the bits not matching. Thetransistors T₄-T₅ discharge the node 62 for the other case of bit 0mismatch. The transistors T₆-T₉ and T₁₀-T₁₃ similarly detect the casesof mismatch for bits 1 and 2, respectively. Accordingly, node 62 isdischarged (and the output of the inverter 60 transitions high) if anyof bits 0-2 of the tag and tag portion of in the input address mismatch.If all of bits 0-2 match, the node 62 is not discharged and the outputof the inverter 60 remains low.

FIG. 6 illustrates the circuit 50 of with all of the pairs of dynamicsignals representing the bits of the tag portion of the address beinginhibited from asserting. Each of the transistors T₃, T₅, T₇, T₉, T₁₁,and T₁₃ have their gates driven low, and thus do not conduct, preventingthe discharge of node 62. A similar result may be achieved by inhibitingthe assertion of pairs of dynamic signals representing the tag bits,ensuring that the transistors T₂, T₄, T₆, T₈, T₁₀, and T₁₂ do notconduct.

Turning next to FIG. 7, a flowchart is shown illustrating one embodimentof operating a cache and providing for force hit and force missfunctionality.

If forcing a hit is desired (decision block 70, “yes” leg), state changein the evaluate phase of the dynamic circuitry may be inhibited in thetag comparator for which the hit is desired (block 72). For example, theclock to the dynamic circuitry may be gated, or assertion of each signalof the pairs of dynamic signals representing the tag bits or the bits ofthe tag portion of the address may be inhibited. If forcing a miss isdesired (decision block 74, “yes” leg), the state change in the evaluatephase of the dynamic circuitry may be ensured in the tag comparator forwhich the miss is desired (block 76). In other embodiments, theinhibiting of state change may be performed to force a miss and theensuring of state change may be performed to force a hit, as discussedabove. If neither a hit or a miss is to be forced (decision blocks 70and 74, “no” legs), the comparator operates normally (signalling a hitor miss based on the tag comparison—block 78).

Numerous variations and modifications will become apparent to thoseskilled in the art once the above disclosure is fully appreciated. It isintended that the following claims be interpreted to embrace all suchvariations and modifications.

1. A cache comprising: a tag memory configured to store tags of cacheblocks stored in the cache, wherein the tag memory is coupled to receivean index corresponding to an input address and is configured to outputat least one tag responsive to the index; and a comparator coupled toreceive the at least one tag from the tag memory and a tag portion ofthe input address, wherein the comparator is configured to compare theat least one tag to the tag portion of the input address to generate ahit/miss indication, and wherein the comparator comprises dynamiccircuitry, and wherein the comparator is coupled to receive a controlsignal which, when asserted, is defined to force a first result on thehit/miss indication independent of whether or not the tag portion of theinput address matches the at least one tag from the tag memory, andwherein the comparator comprises first circuitry coupled to receive thecontrol signal and configured to inhibit a state change on an output ofthe dynamic circuitry during an evaluate phase of the dynamic circuitryto produce the first result, and wherein the output remains in aprecharge state established during a precharge phase of the dynamiccircuitry responsive to the first circuitry inhibiting the state changeduring the evaluate phase, and wherein the precharge phase and theevaluate phase are phases of the dynamic circuitry that are controlledby a clock, and wherein the dynamic circuitry is coupled to receive aplurality of pairs of dynamic signals, wherein each pair of dynamicsignals represents either a bit of the tag portion of the input addressor a bit of the at least one tag, and wherein a first signal of eachpair represents the bit of the at least one tag or the bit of the tagportion of the input address and a second signal of each pair representsa complement of the bit of the at least one tag or the bit of the tagportion of the input address, and wherein the first circuitry isconfigured to inhibit assertion of the first signal and to inhibitassertion of the second signal corresponding to each bit of either theat least one tag or the tag portion of the input address responsive toan assertion of the control signal, wherein inhibiting the assertion ofthe first signal and the second signal results in the first result fromthe dynamic circuitry.
 2. The cache as recited in claim 1 wherein thedynamic circuitry is coupled to receive a second control signal which,when asserted, is defined to force a second result on the hit/missindication, wherein the second result is opposite of the first result,and wherein the dynamic circuitry is configured to change stateresponsive to assertion of the second control signal.
 3. The cache asrecited in claim 1 wherein the first result is a hit.
 4. The cache asrecited in claim 1 wherein the first result is a miss.
 5. The cache asrecited in claim 1 further comprising a plurality of comparatorsincluding the comparator, wherein each of the plurality of comparatorsis coupled to receive one of a plurality of tags output by the tagmemory in response to the index, and wherein each of the plurality ofcomparators is coupled to receive a separate control signal to force thefirst result.
 6. A cache comprising: a tag memory configured to storetags of cache blocks stored in the cache, wherein the tag memory iscoupled to receive an index corresponding to an input address and isconfigured to output at least one tag responsive to the index; and acomparator coupled to receive the at least one tag from the tag memoryand a tag portion of the input address, wherein the comparator isconfigured to compare the at least one tag to the tag portion of theinput address to generate a hit/miss indication, and wherein thecomparator comprises dynamic circuitry, and wherein the comparator iscoupled to receive a control signal which, when asserted, is defined toforce a first result on the hit/miss indication independent of whetheror not the tag portion of the input address matches the at least one tagfrom the tag memory, and wherein the comparator comprises firstcircuitry coupled to receive the control signal and configured toinhibit a state change on an output of the dynamic circuitry during anevaluate phase of the dynamic circuitry to produce the first result, andwherein the output remains in a precharge state established during aprecharge phase of the dynamic circuitry responsive to the firstcircuitry inhibiting the state change during the evaluate phase, andwherein the dynamic circuitry is coupled to receive a plurality of pairsof dynamic signals, wherein each pair of dynamic signals represents abit of the tag portion of the input address, and wherein a first signalof each pair represents the bit and a second signal of each pairrepresents a complement of the bit, and wherein the first circuitry isconfigured to inhibit assertion of the first signal and the secondsignal corresponding to each bit of the tag portion of the input addressto inhibit state change of the dynamic circuitry.
 7. The cache asrecited in claim 6 wherein the first circuitry comprises a clock gatercircuit configured to supply a clock in the first circuitry, wherein theclock gater circuit is configured to gate the clock responsive toassertion of the control signal.
 8. A cache comprising: a tag memoryconfigured to store tags of cache blocks stored in the cache, whereinthe tag memory is coupled to receive an index corresponding to an inputaddress and is configured to output at least one tag responsive to theindex; and a comparator coupled to receive the at least one tag from thetag memory and a tag portion of the input address, wherein thecomparator is configured to compare the at least one tag to the tagportion of the input address to generate a hit/miss indication, andwherein the comparator comprises dynamic circuitry, and wherein thecomparator is coupled to receive a control signal which, when asserted,is defined to force a first result on the hit/miss indicationindependent of whether or not the tag portion of the input addressmatches the at least one tag from the tag memory, and wherein thecomparator comprises first circuitry coupled to receive the controlsignal and configured to inhibit a state change on an output of thedynamic circuitry during an evaluate phase of the dynamic circuitry toproduce the first result, and wherein the output remains in a prechargestate established during a precharge phase of the dynamic circuitryresponsive to the first circuitry inhibiting the state change during theevaluate phase, and wherein the dynamic circuitry is coupled to receivea plurality of pairs of dynamic signals, wherein each pair of dynamicsignals represents a bit of the tag, and wherein a first signal of eachpair represents the bit and a second signal of each pair represents acomplement of the bit, and wherein the first circuitry is configured toinhibit assertion of the first signal and the second signalcorresponding to each bit of the tag to inhibit state change of thedynamic circuitry.
 9. The cache as recited in claim 8 wherein the firstcircuitry comprises a clock gater circuit configured to supply a clockin the first circuitry, wherein the clock gater circuit is configured togate the clock responsive to assertion of the control signal.
 10. Amethod comprising: in response to an assertion of a control signal to acache, the assertion of the control signal defined to force a firstresult on a comparator output independent of whether or not a tagportion of an input address to the cache matches a tag output from a tagmemory in the cache, inhibiting a state change in dynamic circuitryincluded in a comparator during an evaluate phase of the dynamiccircuitry, wherein inhibiting the state change comprises retaining aprecharge state established during a precharge phase of the dynamiccircuitry, and wherein inhibiting the state change comprises inhibitingassertion of each of a plurality of pairs of dynamic signalscorresponding to bits of the tag portion of the input address or thetag, wherein one of each pair represents a corresponding bit and anotherof each pair represents a complement of the corresponding bit; and inresponse to the control signal not being asserted to the cache, thecomparator performing a comparison of the tag portion of the inputaddress and the tag output from the tag memory, the comparison includingthe dynamic circuitry conditionally changing state during the evaluatephase based on the tag portion of the input address and the tag outputfrom the tag memory.
 11. The method as recited in claim 10 furthercomprising the dynamic circuitry changing state in response to anassertion of a second control signal, the assertion defined to force asecond result on the comparator output.
 12. A cache comprising: a tagmemory configured to store tags of cache blocks stored in the cache,wherein the tag memory is coupled to receive an index corresponding toan input address and is configured to output at least one tag responsiveto the index; and a comparator coupled to receive the at least one tagfrom the tag memory and a tag portion of the input address, wherein thecomparator is configured to compare the at least one tag to the tagportion of the input address to generate a hit/miss indication, andwherein the comparator is coupled to receive a control signal which,when asserted, is defined to force a first result on the hit/missindication independent of whether or not the tag portion of the inputaddress matches the at least one tag from the tag memory, and whereinthe comparator comprises dynamic circuitry coupled to receive aplurality of pairs of dynamic signals, wherein each pair of dynamicsignals represents either a bit of the at least one tag or a bit of theinput address, and wherein a first signal of each pair represents thebit of the at least one tag or the bit of the input address and a secondsignal of each pair represents a complement of the bit of the at leastone tag or the bit of the input address, and wherein the comparator isconfigured to inhibit assertion of both the first signal and the secondsignal of each pair corresponding to one of the input address or the atleast one tag responsive to assertion of the control signal to producethe first result.
 13. The cache as recited in claim 12 wherein thecomparator comprises first circuitry coupled to receive the controlsignal and configured to inhibit assertion of both signals of each pair.14. The cache as recited in claim 13 wherein the first circuitrycomprises a clock gater having an enable input that is controlledresponsive to the control signal.
 15. The cache as recited in claim 14wherein the first circuitry further comprises a senseamplifier circuitcoupled to receive the input address and configured to generate thepairs of dynamic signals corresponding to the input address bits,wherein the clock gater is coupled to provide an evaluate clock to thesenseamplifier circuit.
 16. The cache as recited in claim 15 wherein thesenseamplifier circuit is configured to precharge the pairs of dynamicsignals to a deasserted state.